<template>
	<view class="page">

		<text>{{message}}</text>
		<button @click="copy">复制</button>
		<button @click="print">粘贴</button>
	
	</view>
</template>

<script>
	import bwSwiper from '@/wxcomponents/bw-swiper/bw-swiper.vue'

	export default {
		components: {
	
			bwSwiper
		
		},
		data() {
			return {
				message:"测试剪贴板"
			}
		},
		computed:{
		
		},
		onLoad() {
			// 判断是否有token
			// var token = uni.getStorageSync('token')
			
			// if (token) {
			// 	console.log('token')
			// 	this.getData()
			// } else {
			// 	uni.redirectTo({
			// 		url: '../login/index'
			// 	})
			// }
		},
		methods: {
			copy(){
				uni.setClipboardData({
					data: this.message,
					success: function (e) {
						console.log('success:'+e);
					}
				});
			},
			print() {
				
				uni.getClipboardData({
					success: function (res) {
						console.log(res.data);
					}
				});
				
			}

		}
	}
</script>

<style lang="scss">
	.page {
		.commonItem {
			width: 100%;
			padding: 10px;
			box-sizing: border-box;

			.itemCon {
				width: 100%;
				display: flex;
				flex-direction: column;


				.itemDetail {
					width: 100%;
					display: flex;
					align-items: center;
					height: 100rpx;
					border-bottom: 1px solid #C8C7CC;

					text {
						margin-right: 20px;
					}
				}

			}
		}
		
	}
</style>
